← Course index · R314 System & Network
MMIIUT de Vélizy

DNS

Domain Name System

Architecture, Hierarchy, and Resolution Protocols

Why DNS?

Computers communicate using IP addresses (e.g., 192.0.2.1), but humans memorize names (e.g., google.com).

DNS is the phonebook of the Internet:

  • Name Resolution: Translating a hostname into an IP address.
  • Reverse Resolution: Finding the domain name from an IP.
  • Service Identification: Locating mail servers (MX) and other services.
DNS Zone Diagram

A Brief History

Pre-1984: Centralized

A single file HOSTS.TXT maintained by SRI-NIC. Every computer had to manually download this file via FTP. Scalability was impossible.

Post-1984: Distributed

Paul Mockapetris invented DNS (RFC 1034/1035). The system is:

  • Hierarchical: Inverted tree structure.
  • Distributed: Database spread globally.
  • Dynamic: Automatic updates.
Old HOSTS.TXT file

System Architecture

The DNS ecosystem rests on three fundamental pillars:

Name Space

The hierarchical tree structure of data and domain names.

Name Servers

Server programs that hold "Zones" of data and answer queries.

Resolvers

Client-side programs that query the system to get an answer.

The Hierarchy

DNS is an inverted tree starting at the Root (.).

  • Root (.): The top of the tree.
  • TLD (Top Level Domain): .com, .org, .fr.
  • Domain (2nd Level): google, amazon.
  • Subdomain: www, mail, dev.

A complete name is a FQDN (Fully Qualified Domain Name).

DNS Hierarchy Tree

Root Servers

There are 13 logical root server identities, named A through M (e.g., a.root-servers.net).

Managed by organizations like Verisign, NASA, RIPE NCC, etc.

Anycast Magic

There are hundreds of physical servers. Anycast routing directs queries to the closest physical server for speed and redundancy.

Map of Root Servers

Delegation and Zones

The Zone

A zone is a physical file containing data for a specific slice of the DNS tree, managed by a specific administrator.

Delegation

The act of transferring responsibility for a subdomain to another nameserver.

Root delegates .com to Verisign. Verisign delegates google.com to Google.

Delegation Flow

Server Roles

Primary Server (Master)

The authoritative source. This is the only server where the admin makes changes (Read/Write).

Secondary Server (Slave)

Read-only backup. It downloads data via Zone Transfer (AXFR).

Crucial for redundancy and load balancing.

Zone Transfer Diagram

Resolution Process

Resolution Process

1. Recursive Query

Client to Resolver: "Go find the IP for me."

2. Iterative Queries

Resolver to Hierarchy: "I will ask each level step-by-step."

  1. Ask Root: "Who handles .com?"
  2. Ask TLD: "Who handles example.com?"
  3. Ask Authoritative: "What is the IP?"

Caching & TTL

To prevent global network collapse, answers are stored temporarily (Caching).

TTL (Time To Live)

A value in seconds dictating how long a record stays in cache.

  • Short TTL (60s): Fast updates, high load.
  • Long TTL (86400s): Stable, slow updates.
TTL Concept

Resource Records (RR)

Type Name Description
A Address Maps hostname to IPv4 (32-bit).
AAAA Quad A Maps hostname to IPv6 (128-bit).
CNAME Canonical Name Alias to another name.
MX Mail Exchange Mail server priority and location.
NS Name Server Delegates a zone to an authoritative server.
TXT Text Security verification (SPF, DKIM).

Diagnostic Tools

  • nslookup: Legacy tool. Available on all OS. Good for simple checks.
  • dig: (Domain Information Groper). Standard Linux/macOS tool. Verbose and precise.
$ dig google.com +short
142.250.75.238

$ dig google.com MX +short
10 smtp.google.com.

DNS Security

Original DNS was unencrypted (UDP 53), vulnerable to Spoofing and Cache Poisoning.

Solutions

  • DNSSEC: Cryptographic signatures for records.
  • DoH (DNS over HTTPS): Encrypted queries inside HTTPS traffic (Port 443).
  • DoT (DNS over TLS): Encrypted tunnel for DNS (Port 853).